
package com.joolun.cloud.mall.api.controller;

import com.joolun.cloud.common.core.constant.CommonConstants;
import com.joolun.cloud.common.core.util.R;
import com.joolun.cloud.mall.common.entity.GoodsCategoryShop;
import com.joolun.cloud.mall.api.service.GoodsCategoryShopService;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

/**
 * 店铺商品分类表
 *
 * @author www.joolun.com
 * @date 2020-08-26 11:51:54
 */
@Slf4j
@RestController
@AllArgsConstructor
@RequestMapping("/goodscategoryshop")
@Api(value = "goodscategoryshop", tags = "店铺商品分类API")
public class GoodsCategoryShopController {

    private final GoodsCategoryShopService goodsCategoryShopService;

	/**
	 *  返回树形集合
	 * @return
	 */
	@ApiOperation(value = "返回树形集合")
	@GetMapping("/tree")
	public R getTree(GoodsCategoryShop goodsCategoryShop) {
		goodsCategoryShop.setEnable(CommonConstants.YES);
		return R.ok(goodsCategoryShopService.selectTree(goodsCategoryShop));
	}

}
